﻿using System;
using System.Text;

namespace dotHTML.HTML {
    /// <summary>
    /// Defines a widget from which the user can retrieve additional
    /// information.
    /// </summary>
    [Serializable]
    public class Details : Element {
        private bool _open;

        /// <summary>
        /// Determines whether the control is shown to the user on page load.
        /// </summary>
        public bool Open {
            get { return _open; }
            set { _open = value; }
        }

        /// <summary>
        /// Gets a formatted string of all local attributes of this element
        /// (not including the base attributes).
        /// </summary>
        /// <param name="sb">The StringBuilder to write this element's
        /// attribute data to.</param>
        protected override void WriteLocalAttributes(StringBuilder sb) {
            AttributeWriter.Write(sb, _open, "open");
        }
    }
}
